# Makefile

CC = gcc
CFLAGS = -Wall -Wextra -std=c99

# 编译生成可执行文件
all: main

# 编译main.c和sensor_driver.c生成可执行文件main
main: main.o sensor_driver.o
	$(CC) $(CFLAGS) -o main main.o sensor_driver.o

# 编译main.c生成目标文件main.o
main.o: main.c sensor_driver.h
	$(CC) $(CFLAGS) -c main.c

# 编译sensor_driver.c生成目标文件sensor_driver.o
sensor_driver.o: sensor_driver.c sensor_driver.h
	$(CC) $(CFLAGS) -c sensor_driver.c

# 清除生成的目标文件和可执行文件
clean:
	rm -f *.o main
